<?php


namespace app\common\controller;


use app\common\logic\BaseLogic;
use app\common\validate\BaseValidate;
use support\traits\ApiResponse;
use support\utils\Form;

class BaseApiController
{
    use ApiResponse;

    protected $noNeedLogin = []; //是否不需要登录
    /**
     * 逻辑层注入
     * @var BaseLogic
     */
    protected $logic;

    /**
     * 验证器注入
     * @var BaseValidate
     */
    protected $validate;
    protected Form $form;

    public function __construct()
    {
        $this->init();

        $this->form = request()->getForm();
    }

    protected function init()
    {
        $this->logic && $this->logic->init();
    }
}